﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPSocialTagCounters.Helpers
{
    public static class LayoutHelper
    {
        public static string HTML = @"
<div class='tagging'>
    <div class='tags'>
        <div class='number'>{0}</div>
        <div class='arrow-right'></div>
        <div id='PageTags'>
            <div class='arrow-up'></div>
            {1}
        </div>
    </div>
    <div class='likes'>
        <div class='number'>{2}</div>
        <div class='arrow-right'></div>
        <div id='PageLikes'>
            <div class='arrow-up'></div>
            {3}
        </div>
    </div>
</div>";

        public static string CSS = @"
/*
    * Tags Counters
    */
.tagging {
    height: 50px;
    margin-right: 20px;
    min-width: 35px;
}
.tagging>div {
    height: 20px;
    min-width: 50%;
    padding-left: 24px;
}
.tagging .number {
    font-size: 16px;
    font-weight: bold;
    float: left;
}
.tags {
    background: #E7E7E8 url(/_layouts/images/socialtag.png) no-repeat 4px center;
    margin-bottom: 7px;
}
.likes {
    background: #E7E7E8 url(/_layouts/images/QuickTagILikeIt_16.png) no-repeat 4px center;
}
.arrow-right {
	border-bottom: 10px inset transparent;
	border-left:10px solid #E7E7E8;
	border-top: 10px inset transparent;
	float: right;
	height: 0;
	margin-right: -10px;
    width: 0;
}
    
/*
    * Likes List
    */
#PageLikes, #PageTags {
    background: #E7E7E8;
    display: none;
    margin: 32px 0 0 -25px;
    padding: 5px;
    position: absolute;
    width: 150px;
    z-index: 9999;
}
#PageLikes a, #PageTags a {
    display: block;
    margin-bottom: 5px;
}
    
#PageLikes .arrow-up, #PageTags .arrow-up {
	border-bottom: 10px solid #E7E7E8;
	border-left: 10px inset transparent;
	border-right: 10px inset transparent;
	height: 0;
    left: 10px;
    padding-bottom: 0;
    position: absolute;
    top: -10px;
    width: 0;
}";

        public static string JS = @"
<script>!window.jQuery && document.write('<script src=""http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js""><\/script>')</script>
<script>
    $(function () {
        $('.likes').hover(function () {
            $('#PageLikes:has(a)').show();
        }, function () {
            $('#PageLikes').hide();
        });

        $('.tags').hover(function () {
            $('#PageTags:has(a)').show();
        }, function () {
            $('#PageTags').hide();
        });
    });
</script>";
    }
}
